package br.usjt.component.login.beans;

import static br.com.usjt.component.commons.login.util.ValidationUtil.isNull;

import java.io.Serializable;

public abstract class AbstractBean implements Serializable {

    private static final long serialVersionUID = 1983217446263891809L;

    protected void validarDTO(Object dto) {
        if (isNull(dto)) {
            throw new IllegalArgumentException("DTO is null");
        }
    }

    protected void validarInformacao(Object... args) {

        for (Object object : args) {
            if (isNull(object)) {
                throw new IllegalArgumentException("Arguments invalids!");
            }
        }

    }
}
